public class Test3 implements ITest, ITTest{
    int i = 100;

    static {
        System.out.println("Test3静态代码块");
    }

    {
        System.out.println("Test3非静态代码块");
        i = 200;
    }

    Test3() {
        i = 1000;
    }

    // 如果两个interface中有相同签名abstract方法，在实现类中实现时，会看作一起实现了，所以没有冲突
    @Override
    public int getSize() {
        return 0;
    }

    // 如果两个interface中有相同签名的default方法，那么就必须要重写该方法
    @Override
    public void print() {
        ITest.super.print();
    }

    public static class Inner {
        int data = 100;
        public Inner() {
            System.out.println("Test3::Inner");
        }
    }
}

class Test {
    static int i = 100;
    static double d = 200.0;
    float f = 0.111F;

    static {
        class TTTT {
            public TTTT() {
                System.out.println("Test3::TTTT");
                System.out.println(i);
            }
        }
    }

    private class III {
        III() {
            System.out.println("Test3::III");
        }
    }
    public static void main(String[] args) {
//        Test3 t = new Test3();
//        t.print();

        class Inner {
            Inner() {
                System.out.println("Inner");
            }
        }

//
//        Test3.Inner inner = new Test3.Inner();
//        System.out.println(inner.data);

//        System.out.println(getObj(666));

        Test test = new Test(){};
        System.out.println(test);
    }

    private static Object getObj(int i) {
        Object o = new Object(){
            @Override
            public String toString() {
                return "modified Object1";
            }
        };

        return 1 == i ? o : new Object() {
            @Override
            public String toString() {
                return "modified Object2";
            }
        };
    }
}